import {BasicColumn, FormSchema} from '/@/components/Table';
import {render} from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
  {
    title: '租户套餐',
    width: 150,
    dataIndex: 'name',
  },
  {
    title: '状态',
    width: 64,
    dataIndex: 'status',
    customRender: ({text}) => {
      let color = 'green'
      if (text === '2') {
        color = 'red'
      }
      return render.renderTag(render.renderDict(text, 'data_use_status'), color)
    },
  },
  {
    title: '创建时间',
    width: 160,
    dataIndex: 'createdAt',
  },
  {
    title: '创建者',
    width: 90,
    dataIndex: 'createdBy',
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '套餐名',
    component: 'Input',
    // colProps: {span: 6},
  }
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'id',
    component: 'Input',
    show: false
  },
  {
    field: 'name',
    label: '套餐名称',
    component: 'Input',
    required: true
  },
];



export const formPermissionSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'id',
    component: 'Input',
    show: false
  },
  {
    field: 'name',
    label: '套餐名称',
    component: 'Input',
    required: true
  },
  {
    label: '状态',
    field: 'status',
    required: true,
    defaultValue: '1',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'data_use_status',
      placeholder:'请选择状态',
      type: "radio",
    }
  },
  {
    label: '场景',
    required: true,
    field: 'sceneId',
    component: 'ApiSelect'
  }
];
